export default {
  data() {
    return {
      visible: false,
      confirmLoading: false,
      fullscreen: false,
      switchFullscreen: true
    }
  },
  computed: {
    modalOption() {
      return {
        title: '',
        destroyOnClose: true,
        width: '1200px',
        visible: this.visible,
        'fullscreen.sync': this.fullscreen,
        'switchFullscreen': this.switchFullscreen,
        confirmLoading: this.confirmLoading,
        cancelText: '关闭',
        afterClose: this.afterClose
      }
    }
  },
  methods: {
    show() {
      this.visible = true
    },
    close() {
      this.visible = false
    },
    handleOk() {
      console.log('请在组件内实现')
    },
    handleCancel() {
      this.close()
    },
    afterClose() {
      Object.assign(this.$data, this.$options.data.call(this))
    }
  }
}
